package pers.youqu.gateway.controller;

import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author Jason
 * @version 1.0.0
 * @date 2020/12/3 19:35
 * @Description TODO
 */
@RestController
public class FallbackController {

    /**
     * 网关获取服务，默认的超时处理
     * ResponseEntity：可以返回状态码 + 信息
     * @return 超时响应信息
     */
    @GetMapping(value = "/hystrix/fallback")
    public ResponseEntity<String> fallBackController() {
        return ResponseEntity.status(HttpStatus.GATEWAY_TIMEOUT).body("请求超时！");
    }
}
